#ifndef _FILETREE_H_
#define _FILETREE_H_

#include "External.h"
#include <cassert>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <sys/stat.h>
#include <sys/types.h>

using namespace std;

class FileTree
{
	public:
		FileTree(string cwPath, bool createTree, bool verbose);
		~FileTree();
		qGroup_t getQgroupFromFile(qGroup_t family);
		qFam_t getQFamFromFile(qFam_t family);
		bool setQvalueOnFile(qItem_t item);
		qItem_t getQitemFromFile(qItem_t item);
		qItem_t getQitemFromFile(string path);
		void writeDistance(int x, int y, double dist);
		int removeFile(int x, int y);
		void setBiasOnTree();
	private://methods
		bool initTree();
		bool isGoodQitem(qItem_t item);
		int mkpath(string path, mode_t mode);
		string makePathFromItem(qItem_t item);
		qItem_t makeItemFromPath(string path);
		void setBias(int x, int y, int alpha, double bias);
		double getDistance(int x,int y);
	private: //attributes
		string workingPath;
		bool verbose;

};

#endif
